#ifndef COMM_INTERFACE_HPP
#define COMM_INTERFACE_HPP

#include <memory>
#include <vector>
#include <functional>
#include <atomic>

using DataReceivedCallback = std::function<void(const std::vector<uint8_t>&)>;

class CommInterface {
public:
    virtual ~CommInterface() = default;  
    virtual bool initialize() = 0;  
    virtual bool send(const std::vector<uint8_t>& data) = 0;
    virtual std::vector<uint8_t> receive() = 0;
    virtual void registerCallback(DataReceivedCallback callback) = 0;
    virtual std::string getName() const = 0;
    virtual bool isConnected() const = 0;
    virtual void shutdown() = 0;
//    virtual void testSend() = 0;
 };

enum DATAType{
    UART_NONE = 0xA0,     // Uart no crc
    CAN_NONE = 0xB0,     // Can no crc
    IIC_NONE = 0xC0,     // IIC no crc
    SPI_NONE = 0xD0,     // SPI no crc
    LIN_NONE = 0xE0,     // LIN no crc
}; 
#endif // COMM_INTERFACE_HPP